<template>
  <button
    class="theme-toggle-btn text-gray-700 dark:text-gray-200"
    @click="toggleTheme"
  >
    {{ appStore.theme === 'light' ? '🌙' : '☀️' }}
  </button>
</template>

<script setup lang="ts">
import { useAppStore } from '../../store/app'

const appStore = useAppStore()
// 切换主题
const toggleTheme = () => {
  const newTheme = appStore.theme === 'light' ? 'dark' : 'light'
  appStore.setTheme(newTheme)
}
</script>